import taskLists from 'markdown-it-task-lists'
import { defineConfig } from 'vitepress-theme-async/config'

export default defineConfig({
  cleanUrls: true,
  base: '/docs',
  markdown: {
    config(md) {
      md.use(taskLists)
    },
  },
  lang: 'zh-CN',
  titleTemplate: ':title | 星蘅',
  themeConfig: {
    postDir: 'docs',
    rewritePost: true,
    author: '星蘅',
    // 分页规则
    indexGenerator: {
      static: true,
    },
    // 归档分页
    archiveGenerator: {
      static: true,
    },
    // 全局组件
    globalComponents: true,
    topBars: [
      { title: '首页', url: '/' },
      { title: '归档', url: '/archives/' },
      { title: '分类', url: '/categories' },
      { title: '标签', url: '/tags' },
      { title: '友链', url: '/links' },
      { title: '关于', url: '/about' },
    ],
    // 侧边栏
    sidebar: {
      typedTextPrefix: '欢迎访问',
      typedText: ['我的博客!', 'dipper-alioth'],
      info: [
        {
          key: '前端',
          val: 'React、Vue、TS、ArkTS',
        },
        {
          key: '服务端',
          val: 'JAVA、Nest.js、cj',
        },
        {
          key: '桌面端',
          val: 'Electron',
        },
      ],
      social: [
        {
          name: 'github',
          url: 'https://github.com/dipper-alioth',
          icon: `<svg t="1752753942137" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7499" width="200" height="200"><path d="M20.48 503.72608c0 214.4256 137.4208 396.73856 328.94976 463.6672 25.8048 6.5536 21.87264-11.8784 21.87264-24.33024v-85.07392c-148.93056 17.44896-154.86976-81.1008-164.94592-97.52576-20.23424-34.52928-67.91168-43.33568-53.69856-59.76064 33.91488-17.44896 68.48512 4.42368 108.46208 63.61088 28.95872 42.88512 85.44256 35.6352 114.15552 28.4672a138.8544 138.8544 0 0 1 38.0928-66.7648c-154.25536-27.60704-218.60352-121.77408-218.60352-233.79968 0-54.31296 17.94048-104.2432 53.0432-144.54784-22.36416-66.43712 2.08896-123.24864 5.3248-131.6864 63.81568-5.7344 130.00704 45.6704 135.168 49.68448 36.2496-9.78944 77.57824-14.9504 123.82208-14.9504 46.4896 0 88.064 5.3248 124.5184 15.23712 12.288-9.4208 73.80992-53.53472 133.12-48.128 3.15392 8.43776 27.0336 63.93856 6.02112 129.4336 35.59424 40.38656 53.69856 90.76736 53.69856 145.24416 0 112.18944-64.7168 206.4384-219.42272 233.71776a140.0832 140.0832 0 0 1 41.7792 99.9424v123.4944c0.86016 9.87136 0 19.6608 16.50688 19.6608 194.31424-65.49504 334.2336-249.15968 334.2336-465.5104C1002.57792 232.48896 782.66368 12.77952 511.5904 12.77952 240.18944 12.65664 20.48 232.40704 20.48 503.72608z" fill="#000000" opacity=".65" p-id="7500"></path></svg>`,
        },
        {
          name: 'gitee',
          url: 'https://gitee.com/dipper-alioth',
          icon: `<svg t="1752753902292" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2448" width="200" height="200"><path d="M512 1021.72444445A509.72444445 509.72444445 0 1 1 512 2.27555555a509.72444445 509.72444445 0 0 1 0 1019.4488889z m257.99338667-566.37667556H480.54272a25.19495111 25.19495111 0 0 0-25.19495111 25.19495111v62.91456c0 13.90819555 11.28675555 25.19495111 25.12213333 25.19495111h176.21902223c13.98101333 0 25.19495111 11.28675555 25.1949511 25.12213334v12.59747555c0 41.72458667-33.78744889 75.51203555-75.51203555 75.51203555H367.23825778a25.19495111 25.19495111 0 0 1-25.12213333-25.12213333V417.62816c0-41.72458667 33.78744889-75.51203555 75.43921777-75.51203555h352.43804445c13.83537778 0 25.12213333-11.28675555 25.12213333-25.19495112v-62.91456a25.19495111 25.19495111 0 0 0-25.12213333-25.19495111h-352.43804445a188.74368 188.74368 0 0 0-188.74368 188.81649778v352.36522667c0 13.90819555 11.28675555 25.19495111 25.19495111 25.19495111h371.22503112a169.88387555 169.88387555 0 0 0 169.95669333-169.88387556V480.54272a25.19495111 25.19495111 0 0 0-25.19495111-25.19495111z" fill="#C71D23" p-id="2449"></path></svg>`,
        },
        {
          name: 'gitcode',
          url: 'https://gitcode.com/aliothstar',
          icon: `<svg t="1752753775684" class="icon" viewBox="0 0 1056 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1485" width="200" height="200"><path d="M479.663158 988.429474c-90.004211-10.24-187.553684-48.505263-247.376842-96.471579-33.953684-26.947368-90.004211-88.387368-111.023158-120.724211-64.134737-99.166316-90.004211-222.046316-70.602105-333.608421 18.863158-107.250526 63.056842-191.326316 141.20421-267.856842 135.814737-133.12 353.010526-175.157895 527.090526-101.861053 57.128421 24.252632 112.101053 58.206316 134.736843 82.997895 44.193684 49.044211 28.025263 128.808421-31.258948 158.450526-25.330526 12.395789-72.218947 12.934737-90.543158 1.077895s-35.031579-44.193684-39.343158-77.069473c-2.155789-15.629474-4.850526-28.564211-5.389473-28.564211-1.077895 0-14.551579 7.545263-29.642106 16.168421-49.583158 29.103158-64.134737 33.414737-140.126315 38.265263-39.882105 2.155789-84.075789 5.928421-97.549474 8.084211-24.791579 3.233684-54.972632-1.077895-102.938947-16.168421l-25.330527-8.084211 1.077895 52.277895c0.538947 50.661053 0 53.355789-21.557895 98.088421-28.025263 58.206316-38.265263 93.237895-42.576842 144.976842-10.24 124.496842 57.667368 217.195789 186.47579 253.844211 83.536842 23.713684 221.507368 18.863158 296.421052-10.778948 71.68-28.564211 134.736842-94.854737 134.736842-142.282105 0-19.402105-24.791579-44.193684-51.738947-50.661053-11.317895-3.233684-54.433684-7.006316-95.393684-8.623158-86.770526-3.772632-147.132632-11.856842-163.84-22.635789s-25.330526-40.96-17.785263-63.59579c7.545263-23.713684 19.402105-33.953684 54.433684-46.888421 23.713684-9.162105 40.96-10.778947 109.945263-10.778947 146.593684 0 215.578947 18.324211 269.473684 72.218947 61.978947 62.517895 68.446316 157.372632 16.168421 241.448421-77.069474 123.418947-168.151579 194.021053-291.570526 225.818948-41.498947 11.317895-151.444211 18.324211-196.176842 12.934737z" fill="#D62240" p-id="1486"></path></svg>`,
        },
      ],
    },
    // 配置用户信息
    user: {
      name: '星蘅',
      firstName: '博客',
      lastName: '星蘅',
      email: 'aliothstar@aliyun.com',
      avatar: '/avatar.png',
      describe: '一个菜鸡的程序员',
      domain: 'https://dipper-alioth.github.io/docs/',
    },
    // 配置网站信息
    footer: {
      copyrightYear: '2025',
      liveTime: {
        enable: true,
        startTime: '2025/7/17',
      },
    },
    // 配置网站图标
    favicon: {
      logo: '/favicon.png',
      icon16: '/favicon.png',
      icon32: '/favicon.png',
    },
    // 配置友链
    links: [
      {
        name: 'kimo',
        url: 'https://matrix-johnjohn.github.io/docs/',
        image: 'https://w.wallhaven.cc/full/je/wallhaven-je82zp.jpg',
        desc: '全栈开发',
      },
    ],
    // 固定按钮
    rightside: {
      readmode: true,
      aside: true,
    },
    outline: {
      level: [2, 6],
    },
    // 版权信息
    creativeCommons: {
      post: true,
      clipboard: true,
    },
    // 上下篇
    postPagination: {
      enable: true,
      type: 'large',
    },
    // 搜索
    search: {
      provider: 'local',
    },
    page: {
      archives: '/archives/',
      tags: '/tags',
      categorys: '/categories',
      index: '/',
    },
    // 过期提醒
    noticeOutdate: {
      enable: true,
      limitDay: 1,
      style: 'flat',
      position: 'top',
    },
    // 自定义样式
    themeColor: {
      enable: true,
      primary: ['#ce86e3', '#e0a4e2'],
      primaryWeak: ['#bbd6e1', '#add8fb'],
    },
    // 关于页面
    about: {
      title: '北斗七星，玉蘅为音。路至之远方以星为引，以己证道。',
      introduction:
        '大家好，我是 <strong>星蘅</strong>，很高兴您能在浩瀚如烟的互联网世界里发现这个博客，更感谢您能够饶有兴致地浏览这个页面。',
      blog: '',
      privacy: '',
    },
  },
})
